﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
using WPClient.Common;

namespace WPClient.ViewModel
{
    class InfoElementViewModel : ViewModelBase
    {
        #region Fields and RelayCommands

        string _content;
        bool? _isUseful;
        bool _isUsefulVotable;
        IEnumerable<string> _tags;
        string _title;

        RelayCommand _isUsefulCommand;

        #endregion

        #region Public Interface

        public InfoElementViewModel()
        { }

        #endregion

        #region Properties

        public string Content
        {
            get { return _content; }
            set
            {
                if (value == _content)
                    return;
                _content = value;
                OnPropertyChanged("Content");
            }
        }
        public bool? IsUseful
        {
            get { return _isUseful; }
            set
            {
                if (value == _isUseful)
                    return;
                _isUseful = value;
                OnPropertyChanged("IsUseful");
            }
        }
        public bool IsUsefulVotable
        {
            get { return _isUsefulVotable; }
            set
            {
                if (value == _isUsefulVotable)
                    return;
                _isUsefulVotable = value;
                OnPropertyChanged("IsUsefulVotable");
            }
        }
        public IEnumerable<string> Tags
        {
            get { return _tags; }
            set
            {
                if (value == _tags)
                    return;
                _tags = value;
                OnPropertyChanged("Tags");
            }
        }
        public string Title
        {
            get { return _title; }
            set
            {
                if (value == _title)
                    return;
                _title = value;
                OnPropertyChanged("Title");
            }
        }

        #endregion

        #region Commands

        public ICommand IsUsefulCommand
        {
            get
            {
                if (_isUsefulCommand == null)
                {
                    _isUsefulCommand = new RelayCommand(
                        () =>
                        { });
                }
                return _isUsefulCommand;
            }
        }

        #endregion
    }
}
